package com.training.web.repository;

import com.training.bean.StageAuthorization;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.List;

public interface WebAuthorizationRepository extends JpaRepository<StageAuthorization, Integer> {
    @Query("SELECT sa FROM StageAuthorization sa WHERE sa.userId = :userId AND sa.stageId = :stageId")
    List<StageAuthorization> findByUserIdAndStageId(@Param("userId") int userId, @Param("stageId") int stageId);
}